﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Pan
{
    public partial class uinfo : System.Web.UI.Page
    {
        protected string uname;
        protected string dc;
        protected string fc;
        protected string sc;
        protected string ct;

        protected void Page_PreInit(object sender, EventArgs e)
        {
            Master.needLogin = true;
            Master.side = 3;
        }

        protected void Page_Init(object sender, EventArgs e)
        {
            this.uname = Master.uname;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = ConfigurationManager.ConnectionStrings["PanConnectionString"].ToString();
            try
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "UserStat";
                cmd.Parameters.Add("@uid", SqlDbType.Int).Value = Master.uid;
                SqlDataReader sdr = cmd.ExecuteReader();
                if (sdr.Read())
                {
                    this.dc = sdr["dc"].ToString();
                    this.fc = sdr["fc"].ToString();
                    this.sc = sdr["sc"].ToString();
                    this.ct = Convert.ToDateTime(sdr["ct"]).ToString("yyyy-MM-dd");
                }
            }
            catch (Exception err)
            {
                
            }
            finally
            {
                conn.Close();
            }
        }
    }
}